package sf.database.meta.def;

import sf.database.dialect.DBDialect;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

/**
 * 表定义
 */
public class TableDef {
    /**
     * 表名（如果和关键字冲突，已经加上引号等符号）
     */
    private String tablename;
    /**
     * MySQL专用。字符集编码
     */
    private Charset charset;
    /**
     * 列定义
     */
    private final StringBuilder columnDefinition = new StringBuilder();

    /**
     * 数据库类型
     */
    private DBDialect profile;
    /**
     * 表备注
     */
    private String tableComment;

    /**
     * 各个字段备注
     */
    private List<String> ccmments = new ArrayList<String>();

    /**
     * 该表上没有主键约束
     */
    private boolean noPkConstraint;

    public String getTablename() {
        return tablename;
    }

    public void setTablename(String tablename) {
        this.tablename = tablename;
    }

    public Charset getCharset() {
        return charset;
    }

    public void setCharset(Charset charset) {
        this.charset = charset;
    }

    public StringBuilder getColumnDefinition() {
        return columnDefinition;
    }

    public String getTableComment() {
        return tableComment;
    }

    public void setTableComment(String tableComment) {
        this.tableComment = tableComment;
    }

    public boolean isNoPkConstraint() {
        return noPkConstraint;
    }

    public void setNoPkConstraint(boolean noPkConstraint) {
        this.noPkConstraint = noPkConstraint;
    }

    public DBDialect getProfile() {
        return profile;
    }

    public void setProfile(DBDialect profile) {
        this.profile = profile;
    }

    public List<String> getCcmments() {
        return ccmments;
    }

    public void setCcmments(List<String> ccmments) {
        this.ccmments = ccmments;
    }
}
